<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/AdminBase.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<title>GI ADMIN</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<?if(0){?>
<link href="css/admin_all.css" rel="stylesheet" type="text/css" />
<?}?>
<link href="<?=$TPL[url]?>css/admin_all.css" rel="stylesheet" type="text/css" />
<script src="<?=$TPL[url]?>js/admin_all.js" language="javascript"></script>
<script>
var imgpath = '<?=$TPL[url]?>images';
</script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<div class="tt">
<?if($tabs){?>
  <ul class="nav3">
  <?
  foreach($tabs as $t_name => $t_url ){
  ?>
  <li><a href="<?=$t_url?>"><?=$t_name?></a></li>
  <?}?>
  </ul>
<?}?>
<?if($tip){?>
  <div class="c"></div>
  <h3>功能提示</h3>
  <div class="tr5"><?=$tip?></div>
<?}?>
 <!-- InstanceBeginEditable name="Content" -->
<style type="text/css">
.fourm{line-height:22px;margin-left:6px;}
.margin{margin-left:50px;};
.fourm span{float:left;background:url(<?=$TPL[url]?>images/setfourm/fourm-one.gif) 0 0 no-repeat;}
.fourm .fourm-one{background-position:left 0;width:40px;height:21px;}
.fourm .fourm-two{background-position:0 -21px;width:40px;height:21px;}
.fourm .fourm_name{float:none;background:none;}
</style>
<h3><span style="margin-right:2em">分类列表</span> <span class="w"><a style="cursor:pointer;" onclick="setall('open');" href="javascript:scroll(0,0)">全部展开</a> | <a style="cursor:pointer;" onclick="setall('close');" href="javascript:scroll(0,0)">全部关闭</a></span></h3>
<form action="<?=$this->url('Batch','do=order')?>" method="post">
  <table cellspacing="0" cellpadding="0" width="100%" id="ftable">
	<tr class="tr3 s3">
		<td class="tal" style="padding-left:30px">[顺序]分类名称</td>
		<td width="7%" nowrap="nowrap" class="tal">添加子菜单</td>
		<td class="tal" width="7%">修改</td>
		<td class="tal" width="7%">删除</td>
	</tr>
	<?
	$i = 0;
	foreach($data as $id => $row){
	$i++;
	extract($row,EXTR_OVERWRITE);
	$_level_ -= 2;
	$tbody= array("<tbody id='cate_$id'>","</tbody>");
	?>
	<?=$_level_ == 0 ? $tbody[1] : ""?>
	<tr class="tr3">
		<td class="tal">
			<?if($_level_ != 0){?>
				<div class="fourm">
				<?=str_repeat('<span class="fourm-two"></span>',$_level_-1)?><span class="fourm-one"></span></div>
			<?} else {?>
				<span id="bt_<?=$id?>" class="close fl" onclick="cateopen('<?=$id?>')"></span>
			<?}?>
				<input name="data[<?=$id?>][sequence]" type="text" class="input tac" id="data[<?=$id?>][sequence]" value="<?=$sequence?>" size="2">
				<?=$name?>
				<font class="gray">ID:<?=$id?></font>&nbsp;&nbsp;</td>
		<td><a class="fourm-two" href="<?=$this->url('Create',"pid=$id")?>"><span class="add" title="添加"></span></a></td>
		<td><a class="fourm-two" href="<?=$this->url('Edit',"id=$id")?>"><span class="edit" title="编辑"></span></a></td>
		<td><a class="fourm-two" onclick="return confirm('你确定要删除该条目吗？')" href="<?=$this->url('Remove',"id=$id")?>"><span class="del" title="删除"></span></a></td>
	</tr>
	<?=$_level_ == 0 ? $tbody[0] : ""?>
	<?}?>
</table>
<br />
<center><input type="submit" value="提 交" class="btn" /></center>
</form>
<script language="JavaScript">
function cateopen(id) {
	var o = getObj('cate_' + id);
	if (o == null) return;
	if (o.style.display == 'none') {
		o.style.display = '';
		getObj('bt_' + id).className = 'close fl';
	} else {
		o.style.display = 'none';
		getObj('bt_' + id).className = 'open fl';
	}
}
function setall(t) {
	var tbs = getObj('ftable').getElementsByTagName('tbody');
	for (var i = 0; i < tbs.length; i++) {
		if (!tbs[i].id.match(/^cate/)) {
			continue;
		}
		var id = tbs[i].id.substr(5);
		if (t == 'open') {
			tbs[i].style.display = '';
			getObj('bt_' + id).className = 'close fl';
		} else {
			tbs[i].style.display = 'none';
			getObj('bt_' + id).className = 'open fl';
		}
	}
}
function IsElement(id){
	return document.getElementById(id)!=null ? true : false;
}
</script><!-- InstanceEndEditable --></div>
<div class="c"></div>
<div class="bottom">
<?include("Footer")?>
</div>
</body>
<!-- InstanceEnd --></html>
